#!/bin/bash
source /etc/profile
workdir={{ rocketmq.install_dir }}rocketmq



start(){
    {% if rocketmq.group == 'rocketmq_cluster_multiple_masters_slaves' %}
    /bin/bash $workdir/bin/mqbroker -c $workdir/conf/2m-2s-async/broker.conf 
    {% else %}
    /bin/bash $workdir/bin/mqbroker -c $workdir/conf/dledger/broker.conf 
    {% endif %}
    
}

stop(){
    /bin/bash $workdir/bin/mqshutdown broker
}

case $1 in
        start)
                start
                ;;
        stop)
                stop
                ;;
        restart)
                stop
                start
                ;;
esac

